package database

import (
	"github.com/garyburd/redigo/redis"
	"time"
)

var Pool *redis.Pool

func InitPool(address string, maxIdle, maxActive int, idleTimeout time.Duration)  {
	Pool = &redis.Pool{
		Dial: func() (redis.Conn, error) {
			return redis.Dial("tcp",address)
		},
		MaxIdle:         maxIdle,
		MaxActive:       maxActive,
		IdleTimeout:     idleTimeout,
	}
}